package com.zy.ems.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.zy.ems.mapper.QuestionMapper;
import com.zy.ems.model.QuestionEntity;

import com.zy.ems.common.base.BaseDao;

@Repository
public class QuestionDao extends BaseDao<QuestionEntity, Integer> {

    @Autowired
    private QuestionMapper questionMapper;

    @Override
    @SuppressWarnings("unchecked")
    public QuestionMapper getMapper() {
        return this.questionMapper;
    }

    @Override
    protected String getNamespace() {
        return QuestionMapper.class.getName();
    }

    /**
     * 批量插入试题
     * 
     * @param questions
     */
    public void saveQuestions(List<QuestionEntity> questions) {
        this.questionMapper.saveQuestions(questions);
    }

    /**
     * 软删除试题
     */
    public void deleteQuestion(List<Integer> ids) {
        this.questionMapper.deleteQuestion(ids);
    }

}
